home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tcxl551.arc / TCXL_INC.EXE / lha / INC / TCXLVID.H < prev    next >
Text File  |  1990-10-01  |  14KB  |  247 lines

  1. /*=====[ The TesSeRact(TM) CXL User Interface Development System ]======*
  2.  | Copyright (c) 1987-1990, Innovative Data Concepts. All Rights Reserved
  3.  |
  4.  | This Library is part of IDC's TesSeRact Development Tools product
  5.  | line. For information about other IDC products, call 1-215-884-3373.
  6.  *----------------------------------------------------------------------*
  7.  | <TCXLvid.h> : Public definitions and prototypes for TCXL video
  8.  | functions. Windowing functions are defined in <TCXLwin.h>, which
  9.  | includes this file.
  10.  *----------------------------------------------------------------------*
  11.  | PGS : $Id: tcxlvid.h 5.51 90/10/01 00:00:00 MLM Release Locker: MLM $
  12.  | $Log:    tcxlvid.h $
  13.  | Revision 5.51  90/10/01  00:00:00  MLM
  14.  | TCXL 5.51
  15.  | 
  16.  *======================================================================*/
  17. #ifndef  _TCXLvid_
  18. #  define   _TCXLvid_ 1       /* only once! */
  19. #  ifndef   _TCXLdef_
  20. #     include  <TCXLdef.h>    /* standard definitions */
  21. #  endif
  22. #  ifndef   _TCXLatr_
  23. #     include  <TCXLatr.h>    /* attribute definitions */
  24. #  endif
  25. #define  V_NONE      0x00     /*- adapter types returned by VidType() --*/
  26. #define  V_MDA       0x01
  27. #define  V_EGAMONO   0x02
  28. #define  V_MCGAMONO  0x03
  29. #define  V_VGAMONO   0x04
  30. #define  V_HGC       0x05
  31. #define  V_HGCPLUS   0x06
  32. #define  V_INCOLOR   0x07
  33. #define  V_CGA       0x08
  34. #define  V_EGA       0x09
  35. #define  V_MCGA      0x0A
  36. #define  V_VGA       0x0B
  37.                               /*- VidParm() video parameter settings ---*/
  38. #define  VP_DMA      0x00     /* direct screen writes                   */
  39. #define  VP_CGA      0x01     /* direct screen writes, no CGA snow      */
  40. #define  VP_BIO      0x02     /* BIOS screen writes                     */
  41. #define  VP_MON      0x03     /* monochrome attribute translate on      */
  42. #define  VP_COL      0x04     /* monochrome attribute translate off     */
  43.                               /*- video flag bits ----------------------*/
  44. #define  VF_MON      0x01     /* monochrome                             */
  45. #define  VF_MAP      0x02     /* map to mono                            */
  46. #define  VF_CGA      0x04     /* suppress CGA snow                      */
  47. #define  VF_BIO      0x08     /* use video BIOS                         */
  48. #define  VF_DQV      0x10     /* DesqView/Windows installed             */
  49.                               /*- Ultravision Flags --------------------*/
  50. #define  VU_RES      0x80     /* Ultravision is resident                */
  51. #define  VU_ACT      0x40     /* Ultravision is active                  */
  52.                               /*- Ultravision Card Codes ---------------*/
  53. #define  VU_GEC      0x00     /* Generic EGA w/ Color monitor           */
  54. #define  VU_GEM      0x04     /* Generic EGA w/ Monochrome monitor      */
  55. #define  VU_GVV      0x05     /* Generic VGA w/ VGA monitor             */
  56. #define  VU_PVV      0x06     /* Paradise VGA w/VGA monitor             */
  57. #define  VU_HVV      0x07     /* Super VGA w/VGA monitor                */
  58. #define  VU_BEE      0x0A     /* UV EGA Booster w/EGA monitor           */
  59. #define  VU_NEE      0x0B     /* NEC GB-1 w/EGA monitor                 */
  60. #define  VU_SEE      0x0C     /* Genoa SuperEGA w/EGA monitor           */
  61. #define  VU_AEE      0x0D     /* Alt EGA Booster w/EGA monitor          */
  62. #define  VU_AEM      0x0E     /* Alt EGA Booster w/Monochrome monitor   */
  63. #define  VU_GVA      0x19     /* Generic VGA w/Autosync monitor         */
  64. #define  VU_PVA      0x1A     /* Paradise VGA w/Autosync monitor        */
  65. #define  VU_HVA      0x1B     /* Super VGA w/Autosync monitor           */
  66. #define  VU_BEA      0x14     /* UV EGA Booster w/Autosync monitor      */
  67. #define  VU_NEA      0x15     /* NEC GB-1 w/Autosync monitor            */
  68. #define  VU_SEA      0x16     /* Genoa SuperEGA w/Autosync monitor      */
  69. #define  VU_AEA      0x17     /* Alt EGA Booster w/Autosync monitor     */
  70.                               /*- Ultravision Video Modes --------------*/
  71. #define  VU_A25      0x11     /* 80x25                                  */
  72. #define  VU_A43      0x12     /* 80x43 on EGA, 80x50 on VGA             */
  73. #define  VU_A34      0x13     /* 80x34 on EGA, 80x36 on VGA             */
  74. #define  VU_A60      0x14     /* 80x60 on EGA, 80x63 on VGA             */
  75. #define  VU_B25      0x19     /* 94x25                                  */
  76. #define  VU_B43      0x1A     /* 94x43 on EGA, 94x50 on VGA             */
  77. #define  VU_B36      0x1B     /* 94x36                                  */
  78. #define  VU_B63      0x1C     /* 94x63                                  */
  79. #define  VU_C25      0x21     /* 108x25                                 */
  80. #define  VU_C43      0x22     /* 108x43 on EGA, 108x50 on VGA           */
  81. #define  VU_C34      0x23     /* 108x34 on EGA, 108x36 on VGA           */
  82. #define  VU_C60      0x24     /* 108x60 on EGA, 108x63 on VGA           */
  83. #define  VU_D25      0x31     /* 120x25                                 */
  84. #define  VU_D43      0x32     /* 120x43 on EGA, 120x50 on VGA           */
  85. #define  VU_D36      0x39     /* 120x36                                 */
  86. #define  VU_D63      0x3A     /* 120x63                                 */
  87. #define  VU_E25      0x33     /* 132x25                                 */
  88. #define  VU_E44      0x34     /* 132x44, 132x50 on SuperVGA only        */
  89. #define  VU_E36      0x3B     /* 132x36                                 */
  90. #define  VU_E60      0x3C     /* 132x60                                 */
  91.  
  92. /*------------------[ Data objects and access macros ]------------------*/
  93.  
  94. TYP   union    Vcel  VcelT, *VcelP;    /* object, pointer types         */
  95. TYP   struct   Vctl  VctlT;
  96. TYP   union    Vcse  VcseT, *VcseP;
  97. TYP   union    Vpos  VposT, *VposP;
  98.  
  99. union    Vcel           /*-[ Video cell object ]------*/
  100. {  WrdT     cwrd;       /* 00 : overlay word          */
  101.    struct               /*                            */
  102.    {  ChrT  chr;        /* 00 : character             */
  103.       AtrT  atr;        /* 01 : attribute             */
  104.    }  c;                /*                            */
  105. };                      /* 02 ]-----------------------*/
  106. #define  VcelW(x)  ((x).cwrd)
  107. #define  VcelC(x)  ((x).c.chr)
  108. #define  VcelA(x)  ((x).c.atr)
  109.  
  110. union    Vcse           /*-[ Video cursor object ]----*/
  111. {  WrdT     cwrd;       /* 00 : overlay word          */
  112.    struct               /*                            */
  113.    {  BytT  end;        /* 00 : stop line             */
  114.       BytT  beg;        /* 01 : start line            */
  115.    }  c;                /*                            */
  116. };                      /* 02 ]-----------------------*/
  117. #define  VcseW(x)  ((x).cwrd)
  118. #define  VcseE(x)  ((x).c.end)
  119. #define  VcseB(x)  ((x).c.beg)
  120.  
  121. union    Vpos           /*-[ Video position object ]--*/
  122. {  WrdT     pwrd;       /* 00 : overlay word          */
  123.    struct               /*                            */
  124.    {  BytT  col;        /* 00 : column                */
  125.       BytT  row;        /* 01 : row                   */
  126.    }  p;                /*                            */
  127. };                      /* 02 ]-----------------------*/
  128. #define  VposW(x)  ((x).pwrd)
  129. #define  VposC(x)  ((x).p.col)
  130. #define  VposR(x)  ((x).p.row)
  131.  
  132. struct   Vctl           /*-[ Video-control object ]---------*/
  133. {  WrdT     vseg;       /* 00|00 : buffer segment           */
  134.    BytT     vhdw;       /* 02|02 : adapter type             */
  135.    BytT     vmod;       /* 03|03 : display-mode             */
  136.    BytT     vflg;       /* 04|04 : flag byte                */
  137.    BytT     vpag;       /* 05|05 : display-page             */
  138.    IntT     vwid;       /* 06|06 : columns wide             */
  139.    IntT     vdep;       /* 08|08 : rows deep                */
  140.    VcseT    vcur;       /* 0A|0A : cursor-save              */
  141.    BytT     vuvf;       /* 0C|0C : Ultravision Flags        */
  142.    BytT     vuvc;       /* 0D|0D : Ultravision Card Code    */
  143.    BytT     vuvm;       /* 0E|0E : Ultravision Text Mode    */
  144.    BytT     vfut;       /* 0F|0F : Reserved for future use  */
  145. };                      /* 10|10 ]--------------------------*/
  146.  
  147. GBL   VctlT CDC   _VidCtl;    /*- Global video-control object ----------*/
  148. #define  VidSeg   (_VidCtl.vseg)                      /* buffer segment */
  149. #define  VidHdw   (_VidCtl.vhdw)                      /* adapter type   */
  150. #define  VidMod   (_VidCtl.vmod)                      /* display mode   */
  151. #define  VidFlg   (_VidCtl.vflg)                      /* flags          */
  152. #define  VidMon   (0 != (VidFlg & VF_MON))            /*    monochrome  */
  153. #define  VidMap   (0 != (VidFlg & VF_MAP))            /*    map to mono */
  154. #define  VidCga   (0 != (VidFlg & VF_CGA))            /*    CGA snow    */
  155. #define  VidBio   (0 != (VidFlg & VF_BIO))            /*    use BIOS    */
  156. #define  VidDqv   (0 != (VidFlg & VF_DQV))            /*    DesQview    */
  157. #define  VidPag   (_VidCtl.vpag)                      /* display page   */
  158. #define  VidWid   (_VidCtl.vwid)                      /* columns wide   */
  159. #define  VidDep   (_VidCtl.vdep)                      /* rows deep      */
  160. #define  VidCur   (_VidCtl.vcur)                      /* cursor save    */
  161. #define  VidUvf   (_VidCtl.vuvf)                      /* UV flags       */
  162. #define  VuvRes   (0 != (VidUvf & VU_RES))            /*    resident    */
  163. #define  VuvAct   (0 != (VidUvf & VU_ACT))            /*    active      */
  164. #define  VidUvc   (_VidCtl.vuvc)                      /* UV card code   */
  165. #define  VidUvm   (_VidCtl.vuvm)                      /* UV text mode   */
  166.  
  167. /*------------------------[ function prototypes ]-----------------------*/
  168.  
  169. #ifdef __cplusplus            /* no mangling, please */
  170.    extern   "C"   {
  171. #endif
  172. IntT  PAS   VatrInv(IntT a);           /* invert attr                   */
  173. IntT  CTYP  VatrMap(IntT a);           /* map attr to mono              */
  174. VOID  CTYP  VatrRev(IntT n);           /* reverse <n> attrs             */
  175. VOID  CTYP  VatrSet(IntT a, IntT n);   /* set <n> attrs                 */
  176. ChrP  CTYP  VatrTxt(IntT a);           /* text description of attr      */
  177. IntT        Vattrib(IntT f, IntT b,    /* construct attr                */
  178.    IntT i, IntT h);
  179. VOID  CTYP  Vclear(IntT a);            /* clear screen to attr          */
  180. VOID        VclrBox(VposT s, VposT e); /* clear box on screen           */
  181. VOID  CTYP  VclrEol(NOARG);            /* clear cursor to EOL           */
  182. VOID  CTYP  VclrScr(NOARG);            /* clear screen                  */
  183. VOID        VcurGet(VposT v);          /* get cursor position           */
  184. IntT  CTYP  VcurHid(IntT s);           /* hide/show cursor, return state*/
  185. VOID        VcurPut(VposT v);          /* put cursor                    */
  186. VOID  CTYP  VcurSet(IntT s);           /* set large/small cursor        */
  187. VOID        VcurSiz(VcseT c);          /* size cursor                   */
  188. VOID        VdrwBox(VposT s, VposT e,  /* draw box on screen            */
  189.    IntT b, IntT a);
  190. VOID        VfilBox(VposT s, VposT e,  /* fill box on screen            */
  191.    IntT c, IntT a);
  192. VOID        Vgetw(IntT r, IntT c,      /* get VcelT at r,c              */
  193.    VcelT x);
  194. VOID  PAS   Vgotoxy(IntT r, IntT c);   /* put cursor at row,col         */
  195. VOID  CTYP  VidInit(NOARG);            /* initialize video              */
  196. IntT  PAS   VidMode(IntT m);           /* get/set display mode          */
  197. WrdT        VidOfs(IntT r, IntT c);    /* calc screen offset            */
  198. IntT  CTYP  VidParm(IntT p);           /* set video parameter           */
  199. VOID  CTYP  VidTerm(NOARG);            /* terminate video               */
  200. IntT  CTYP  VidType(NOARG);            /* get adapter type              */
  201. IntT  CTYP  VlodBox(ChrP f);           /* load box image from disk      */
  202. IntT  CTYP  VlodScr(ChrP f);           /* load screen image from disk   */
  203. VOID        VposGet(IntT r, IntT c);   /* get cursor position as <r,c>  */
  204. VOID  CTYP  Vprintc(IntT r, IntT c,    /* put char/attr at <r,c>        */
  205.    IntT a, IntT x);
  206. VOID  CTYP  Vprints(IntT r, IntT c,    /* put string/attr at <r,c>      */
  207.    IntT a, ChrP s);
  208. VOID  PAS   VputSpa(IntT n);           /* Put <n> spaces                */
  209. VOID  CTYP  Vputc(IntT r, IntT c,      /* put char/attr at r,c          */
  210.    IntT x, IntT a);
  211. VOID        Vputw(IntT r, IntT c,      /* put VcelT at r,c              */
  212.    VcelT x);
  213. VOID  CTYP  Vrestore(VcelP b);         /* restore screen from buffer    */
  214. IntT        VsavBox(VposT s, VposT e,  /* save box image to disk        */
  215.    ChrP f);
  216. VcelP CTYP  Vsave(NOARG);              /* save screen to buffer         */
  217. IntT  CTYP  VsavScr(ChrP f);           /* save screen image to disk     */
  218. VOID        Vscroll(IntT d, VposT s,   /* scroll box on screen          */
  219.    VposT e, IntT n, IntT a);
  220. IntT  CTYP  VsetLin(IntT n);           /* set screen lines              */
  221. WrdT  PAS   VcurGt_(NOARG);            /*- internals -------------------*/
  222. VOID  PAS   VcurPt_(WrdT v);
  223. WrdT  PAS   VcurSz_(WrdT c);
  224. VOID  CTYP  VdrwBx_(WrdT s, WrdT e, IntT b, IntT a);
  225. VOID  CTYP  VfilBx_(WrdT s, WrdT e, IntT c, IntT a);
  226. WrdT  CTYP  Vgetw_(IntT r, IntT c);
  227. VOID  CTYP  Vputw_(IntT r, IntT c, WrdT x);
  228. IntT  CTYP  VsavBx_(WrdT s, WrdT e, ChrP f);
  229. VOID  PAS   Vscrol_(IntT d, WrdT s, WrdT e, IntT n, IntT a);
  230. #define  Vattrib(f,b,i,h)  ((b<<4)|(f)|(i<<3)|(h<<7))
  231. #define  VclrBox(s,e)   (VfilBox((s),(e),' ',(Vgetw_(VposR(s),VposC(s))>>8)))
  232. #define  VcurGet(v)  (VposW(v)=VcurGt_())
  233. #define  VcurPut(v)  (VcurPt_(VposW(v)))
  234. #define  VcurSiz(c)  (VcseW(c)=VcurSz_(VcseW(c)))
  235. #define  VdrwBox(s,e,b,a)  (VdrwBx_(VposW(s),VposW(e),(b),(a)))
  236. #define  VfilBox(s,e,c,a)  (VfilBx_(VposW(s),VposW(e),(c),(a)))
  237. #define  Vgetw(r,c,x) (VcelW(x)=Vgetw_((r),(c)))
  238. #define  VidOfs(r,c)  ((((r)*VidWid)+(c))<<1)
  239. #define  VposGet(r,c) ((c)=MsInt(VcurGt_()); (r)=((c)>>8); (c)&=0xFF)
  240. #define  Vputw(r,c,x) (Vputw_((r),(c), VcelW(x)))
  241. #define  VsavBox(s,e,f) (VsavBx_(VposW(s),VposW(e),(f)))
  242. #define  Vscroll(d,s,e,n,a)   (Vscrol_((d),VposW(s),VposW(e),(n),(a)))
  243. #ifdef __cplusplus
  244.    }
  245. #endif
  246. #endif   /* _TCXLvid_ : End of TCXLvid.h */
  247.